import React from "react";
import { View, Text, ActivityIndicator } from "react-native";

const pageLoading = ({ loading, isEnd }) => {
  return (
    <View
      style={{
        width: "100%",
        justifyContent: "center",
        alignItems: "center",
        paddingTop: 20,
        paddingBottom: 20,
      }}
    >
      {loading ? (
        <ActivityIndicator />
      ) : isEnd ? (
        <Text style={{ color: "rgba(45, 50, 65, .5)" }}>没有更多数据了</Text>
      ) : (
        <Text style={{ color: "rgba(45, 50, 65, .5)" }}>下拉加载更多数据</Text>
      )}
      {/* {!loading && isEnd ? (
        <Text style={{ color: "rgba(45, 50, 65, .5)" }}>没有更多数据了</Text>
      ) : (
        <Text style={{ color: "rgba(45, 50, 65, .5)" }}>下拉加载更多数据</Text>
      )} */}
    </View>
  );
};

export default pageLoading;
